from django.test import TestCase
import requests
import re
# Create your tests here.

regex = '''\
<tr>.*?
    <td class="odd"><a href=".*?">(.*?)</a></td>.*?
    <td class="even"><a href="(.*?)" target="_blank">.*?</a></td>.*?
    <td class="odd">(.*?)</td>.*?
	<td class="even">(.*?)</td>.*?
    <td class="odd" align="center">.*?</td>.*?
    <td class="even" align="center">.*?</td>.*?
</tr>\
'''
url = 'https://www.x23us.com/modules/article/search.php?searchtype=keywords&searchkey=%D6%F7%D4%D7'
req = requests.get(url)
req.encoding = 'gbk'
html = req.text

info = re.findall(regex,html,re.S)
print(info)


























